package com.bjsxt.buyaction.controller;

import com.bjsxt.buyaction.servivce.BuyActionService;
import com.livegoods.commons.vo.LivegoodsResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName : BuyActionController
 * @Description :
 * @Author : ZWZ
 * @Date: 2021/8/27 9:30
 */
@RestController
@CrossOrigin
public class BuyActionController {

    @Autowired
    private BuyActionService buyActionService;


    /**
     * 预倒计时功能
     *
     * @param id
     * @return
     */
    @GetMapping("/buytime")
    public LivegoodsResult buyTime(String id) {
        return buyActionService.bugTime(id);
    }

    /**
     * 预订房屋
     *
     * @param id   商品编号
     * @param user 用户手机号
     * @return
     */
    @GetMapping("/buyaction")
    public LivegoodsResult buyaction(String id, String user) {
        return buyActionService.buyAction(id, user);
    }

}
